﻿namespace WhereIsMyCash.XML
{
    public sealed class XmlParameter
    {
        private string name;
        private string innerText;
        private string namespaceOfPrefix;
        private bool isCDATAInnerText;
        private AttributeParameter[] attributes;

        public XmlParameter()
        {
            //
            // TODO: Add constructor logic here
            //
            this.namespaceOfPrefix = null;
            this.isCDATAInnerText = false;
        }

        public XmlParameter(string name, params AttributeParameter[] attParas)
        {
            this.name = name;
            this.namespaceOfPrefix = null;
            this.attributes = attParas;
            this.isCDATAInnerText = false;
        }

        public XmlParameter(string name, string innerText, params AttributeParameter[] attParas)
        {
            this.name = name;
            this.innerText = innerText;
            this.namespaceOfPrefix = null;
            this.attributes = attParas;
            this.isCDATAInnerText = false;
        }

        public XmlParameter(string name, string innerText, bool isCDATAInnerText, params AttributeParameter[] attParas)
        {
            this.name = name;
            this.innerText = innerText;
            this.namespaceOfPrefix = null;
            this.attributes = attParas;
            this.isCDATAInnerText = isCDATAInnerText;
        }

        public XmlParameter(string name, string innerText, string namespaceOfPrefix, params AttributeParameter[] attParas)
        {
            this.name = name;
            this.innerText = innerText;
            this.namespaceOfPrefix = namespaceOfPrefix;
            this.attributes = attParas;
            this.isCDATAInnerText = false;
        }

        public XmlParameter(string name, string innerText, bool isCDATAInnerText, string namespaceOfPrefix, params AttributeParameter[] attParas)
        {
            this.name = name;
            this.innerText = innerText;
            this.namespaceOfPrefix = namespaceOfPrefix;
            this.attributes = attParas;
            this.isCDATAInnerText = isCDATAInnerText;
        }

        /// <summary>
        /// 元素名称
        /// </summary>
        public string Name
        {
            get 
            { 
                return this.name; 
            }
            set 
            { 
                this.name = value; 
            }
        }

        /// <summary>
        /// 元素值
        /// </summary>
        public string InnerText
        {
            get 
            { 
                return this.innerText; 
            }
            set 
            { 
                this.innerText = value; 
            }
        }

        /// <summary>
        /// 元素InnerText是否是CDATA转义内容
        /// </summary>
        public bool IsCDATAInnerText
        {
            get 
            { 
                return this.isCDATAInnerText; 
            }
            set
            { 
                this.isCDATAInnerText = value;
            }
        }

        /// <summary>
        /// 名称空间
        /// </summary>
        public string NamespaceOfPrefix
        {
            get 
            { 
                return this.namespaceOfPrefix; 
            }
            set 
            { 
                this.namespaceOfPrefix = value;
            }
        }

        /// <summary>
        /// 元素属性
        /// </summary>
        public AttributeParameter[] Attributes
        {
            get 
            { 
                return this.attributes;
            }
            set 
            { 
                this.attributes = value; 
            }
        }
    }
}